package cn.itsource.pojo.vo;

import cn.itsource.pojo.domain.Order;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class ExecuteOrderVo {
    private String orderNo;
    private String customerPhoto;
    private String customerName;
    private String customerPhone;
    private Long customerId;

    private String startPlace;
    private String startLongitude;
    private String startLatitude;

    private String endPlace;
    private String endLongitude;
    private String endLatitude;

    private BigDecimal favourFee;
    private String carPlate;
    private String carType;
    private Date createTime;

    public static ExecuteOrderVo orderToOrderVo(Order order){
        ExecuteOrderVo executeOrderVo = new ExecuteOrderVo();
        executeOrderVo.setOrderNo(order.getOrderNo());
        executeOrderVo.setCustomerPhoto(order.getCustomerPhoto());
        executeOrderVo.setCustomerName(order.getCustomerName());
        executeOrderVo.setCustomerPhone(order.getCustomerPhone());
        executeOrderVo.setCustomerId(order.getCustomerId());
        executeOrderVo.setStartPlace(order.getStartPlace());
        executeOrderVo.setStartLongitude(order.getStartPlaceLongitude());
        executeOrderVo.setStartLatitude(order.getStartPlaceLatitude());
        executeOrderVo.setEndPlace(order.getEndPlace());
        executeOrderVo.setEndLongitude(order.getEndPlaceLongitude());
        executeOrderVo.setEndLatitude(order.getEndPlaceLatiude());
        executeOrderVo.setFavourFee(order.getFavourAmount());
        executeOrderVo.setCarPlate(order.getCarPlate());
        executeOrderVo.setCarType(order.getCarType());
        executeOrderVo.setCreateTime(order.getCreateTime());
        return executeOrderVo;
    }
}